package com.inspection.controller;

import com.inspection.entity.SysUserDO;
import com.inspection.model.dto.LoginDTO;
import com.inspection.model.vo.LoginVO;
import com.inspection.service.LoginService;
import com.inspection.support.Wrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;


    @RequestMapping(value = "/user/login", method = RequestMethod.POST)
    public Wrapper<LoginVO<SysUserDO>> doLogin(@RequestBody LoginDTO login) {

        LoginVO loginVO= loginService.doLogin(login);
        return Wrapper.ok(loginVO);
    }

}
